{% extends 'layout/mange.html' %}

{% block title %}{{ project.name }} - 添加BUG{% endblock %}

{% block content %}
<div class="container-fluid">
    <div class="row">
        <div class="col-md-12">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h3 class="panel-title">{{ project.name }} - 添加BUG</h3>
                </div>
                <div class="panel-body">
                    <form method="post" novalidate>
                        {% csrf_token %}
                        <div class="form-group">
                            <label for="{{ form.title.id_for_label }}">标题</label>
                            {{ form.title }}
                            {% if form.title.errors %}
                                <div class="text-danger">{{ form.title.errors.0 }}</div>
                            {% endif %}
                        </div>
                        <div class="form-group">
                            <label for="{{ form.desc.id_for_label }}">描述</label>
                            {{ form.desc }}
                            {% if form.desc.errors %}
                                <div class="text-danger">{{ form.desc.errors.0 }}</div>
                            {% endif %}
                        </div>
                        <div class="form-group">
                            <label for="{{ form.status.id_for_label }}">状态</label>
                            {{ form.status }}
                            {% if form.status.errors %}
                                <div class="text-danger">{{ form.status.errors.0 }}</div>
                            {% endif %}
                        </div>
                        <div class="form-group">
                            <label for="{{ form.priority.id_for_label }}">优先级</label>
                            {{ form.priority }}
                            {% if form.priority.errors %}
                                <div class="text-danger">{{ form.priority.errors.0 }}</div>
                            {% endif %}
                        </div>
                        <div class="form-group">
                            <label for="{{ form.assign_to.id_for_label }}">指派给</label>
                            {{ form.assign_to }}
                            {% if form.assign_to.errors %}
                                <div class="text-danger">{{ form.assign_to.errors.0 }}</div>
                            {% endif %}
                        </div>
                        <div class="form-group">
                            <label for="{{ form.deadline.id_for_label }}">截止日期</label>
                            {{ form.deadline }}
                            {% if form.deadline.errors %}
                                <div class="text-danger">{{ form.deadline.errors.0 }}</div>
                            {% endif %}
                        </div>
                        <div class="form-group">
                            <button type="submit" class="btn btn-primary">提交</button>
                            <a href="{% url 'bug_list' project_id=project.id %}" class="btn btn-default">取消</a>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
{% endblock %}